// 和用户相关的接口
import request from '@/utils/request'
import type {
  loginFormData,
  loginResponseData,
  userInfoResponseData,
} from './type'

// 统一接口管理
enum API {
  LOGIN_URL = '/admin/acl/index/login',
  USERINFO_URL = '/admin/acl/index/info',
  LOGOUT_URL = '/admin/acl/index/logout',
}

// 暴露请求函数
// 登录接口方法
// export const reqLogin = (data: loginForm) => {
//   return request.post<any, loginResponseData>(API.LOGIN_URL, data)
// }
export const reqLogin = (data: loginFormData) => {
  return request.post<any, loginResponseData>(API.LOGIN_URL, data)
}
// // 登录后 进入首页 获取用户信息接口方法
// export const requserInfo = () => {
//   return request.get<any, userResponseData>(API.USERINFO_URL)
// }
export const reqUserInfo = () => {
  return request.get<any, userInfoResponseData>(API.USERINFO_URL)
}
// 退出方法
export const reqLogOut = () => {
  return request.post<any, any>(API.LOGOUT_URL)
}
